window.onload = function () {
	var popup = document.querySelector('.popup');
	var trigger = document.querySelector('.login-btn').getElementsByTagName('*')[0];
	var accountInput = document.querySelector('.account').getElementsByTagName('*')[1];
	var passwordInput = document.querySelector('.password').getElementsByTagName('*')[1];
	var popupCancel = document.querySelector('.popup').getElementsByTagName('div')[1];
	trigger.addEventListener('click', function (e) {
		e.preventDefault();
		if(accountInput.value == '' || passwordInput.value == ''){	
				popup.style.display = 'block';
				setTimeout(function () {
					popup.style.display = 'none';
				},1000);
		}else{
			window.open('tinyShop.html');
		}
	});
	popupCancel.addEventListener('click', function() {
		if(popup.style.display == 'block'){
			popup.style.display = 'none';
		}
	} );
}
